package com.bingxue.edu.management.education.model.query;

import com.bingxue.edu.common.enums.ChangeTypeEnum;
import com.bingxue.edu.common.enums.OperateSourceEnum;
import com.bingxue.edu.common.enums.OperateStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;

@Data
@Schema(description = "转班调课查询条件")
public class ClassChangeQuery {

    @Schema(description = "学生id")
    private String studentId;

    @Schema(description = "年级")
    private String grade;

    @Schema(description = "转出班级")
    private String originalClassId;

    @Schema(description = "转入班级")
    private String targetClassId;

    @Schema(description = "变更类型")
    @NotNull(message = "变更类型不能为空")
    private ChangeTypeEnum changeType;

    @Schema(description = "申请方式")
    private OperateSourceEnum operateSource;

    @Schema(description = "操作状态")
    private List<OperateStatusEnum> operateStatus;

    @Schema(description = "开始时间")
    private LocalDate createDateFrom;

    @Schema(description = "结束时间")
    private LocalDate createDateTo;

    public LocalDate getCreateDateTo() {
        return createDateTo == null ? null : createDateTo.plusDays(1);
    }
}

